package com.yxmadoc.umlproject.repository;

import com.yxmadoc.umlproject.model.Order;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface OrderRepository extends JpaRepository<Order, Integer> {

    Page<Order> findAllByCustomerId(String customerId, Pageable pageable);

    Page<Order> findAllByRepairerId(String repairerId, Pageable pageable);

    Page<Order> findAllByCustomerIdAndQuotatedTrue(String customerId, Pageable pageable);

    Page<Order> findAllByQuotatedFalse(Pageable pageable);

    Page<Order> findAllByCustomerIdAndCommentedFalse(String customerId, Pageable pageable);

}
